package com.tuanzi.loan.business.service.wallet.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tuanzi.loan.business.entity.wallet.LoanUserWalletWithdrawRecord;
import com.tuanzi.loan.business.repository.wallet.LoanUserWalletWithdrawRecordRepository;
import com.tuanzi.loan.business.repository.wallet.custom.LoanUserWalletWithdrawRecordRepositoryCustom;
import com.tuanzi.loan.business.service.wallet.LoanUserWalletWithdrawRecordService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.wallet.LoanUserWalletWithdrawRecordRequest;
import com.tuanzi.loan.vo.response.wallet.LoanUserWalletWithdrawRecordResponse;

@Debug
@Service
@Transactional
@Retryable(value = { RetryException.class })
public class LoanUserWalletWithdrawRecordServiceImpl extends CommonServiceImpl<LoanUserWalletWithdrawRecord, Long> implements LoanUserWalletWithdrawRecordService{

	@Autowired
	private LoanUserWalletWithdrawRecordRepositoryCustom loanUserWalletWithdrawRecordRepositoryCustom;
	
	@Autowired
	private LoanUserWalletWithdrawRecordRepository loanUserWalletWithdrawRecordRepository;

	@Override
	public Page<LoanUserWalletWithdrawRecordResponse> list(
			PageSearcher<LoanUserWalletWithdrawRecordRequest> pageSearcher) {
		return loanUserWalletWithdrawRecordRepositoryCustom.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
	}

	@Override
	protected JpaRepository<LoanUserWalletWithdrawRecord, Long> getRepository() {
		return loanUserWalletWithdrawRecordRepository;
	}
	
}
